package org.nvframe.event;

import org.nvframe.event.EventService.EVENT_TYPE;

/**
 * 
 * @author Nik Van Looy
 */
public abstract class AbstractEvent implements Event {

	protected EVENT_TYPE eventType;
	
	abstract protected Class<? extends EventListener> getListener();
	
	/**
	 * check if a given listener listens to this event
	 * 
	 */
	public boolean hasListener(EventListener listener) {
		if(getListener().isInstance(listener))
				return true;
		
		return false;
	}
	
	protected EVENT_TYPE setEventType(EVENT_TYPE eventType) {
		return eventType;
	}
	
	public EVENT_TYPE getEventType() {
		return eventType;
	}
}
